package cn.springcloud.book.service;

import cn.springcloud.book.vo.SysUserVo;
import org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;

public class SysUserService {

    public SysUserVo loadUserByUsername(String username) {
        SysUserVo sysUserVo = new SysUserVo();
        sysUserVo.setUsername(username);
        sysUserVo.setPassword("{bcrypt}$2a$10$2kV7N5klgIu6F0SbHVFpJuvh/Yzw/lUsHQEKGd1f1E0qcqSn3Bq3y");
        sysUserVo.setDelFlag("0");
        sysUserVo.setUserId(1);

        UsernamePasswordAuthenticationFilter usernamePasswordAuthenticationFilter = new UsernamePasswordAuthenticationFilter();
        return sysUserVo;
    }

    public SysUserVo loadUserByMobile(String mobile) {
        SysUserVo sysUserVo = new SysUserVo();
        sysUserVo.setUsername(mobile);
        sysUserVo.setPassword("{bcrypt}$2a$10$2kV7N5klgIu6F0SbHVFpJuvh/Yzw/lUsHQEKGd1f1E0qcqSn3Bq3y");
        sysUserVo.setDelFlag("0");
        sysUserVo.setUserId(12);

        return sysUserVo;
    }
}
